import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import AboutView from '../views/AboutView.vue'
import MessageView from '../views/MessageView.vue'
import DefaultLayout from "../layouts/DefaultLayout.vue";


const routes = [
  {
    path: '/',
    redirect: '/w/message'
  },
  {
    path: '/home',
    component: HomeView,
  },
  {
    path: "/w",
    component: DefaultLayout,
    redirect: "/w/hello",
    children: [
      {
        path: "hello",
        component: HomeView,
      },
      {
        path: "about",
        component: AboutView,
      },
      {
        path: "message",
        component: MessageView,
      },
    ],
  },
  {
    path: "/m",
    component: DefaultLayout,
    redirect: "/m/ni",
    children: [
      {
        path: "ni",
        component: MessageView,
      },
      {
        path: "hello",
        component: MessageView,
      },
    ],
  }

];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
